/*************************************************************************
	> File Name: oj-329.cpp
	> Author: Wang Bo
	> Mail: 1276106221@qq.com
	> Created Time: 2021年01月21日 星期四 10时11分52秒
 ************************************************************************/
#include <iostream>
using namespace std;
#define MAX_N 100000
int c[MAX_N + 5];
#define lowbit(a) (a & -a)

void add(int ind, int x, int n) {
    while (ind <= n) {
        c[ind] += x;
        ind += lowbit(ind);
    }
}

int query(int ind) {
    int sum = 0;
    while (ind) {
        sum += c[ind];
        ind -= lowbit(ind);
    }
    return sum;
}


int main() {
    int m, n, pre = 0, a;
    cin >> n;
    for (int i = 1; i <= n; ++i) {
        cin >> a; // 原数组默认是差分数组
        add(i, a - pre, n); //相当于在第i位增加了a-pre
        pre = a;
    }
    cin >> m;
    char s[10];
    int l, r, x;
    for (int i = 0; i < m; ++i) {
        cin >> s;
        switch (s[0]) {
        case 'C': 
            cin >> l >> r >> x;
            add(l, x, n);
            add(r + 1, -x, n);
            break;
        case 'Q': 
            cin >> x;
            cout << query(x) << endl;
            break;
        }
    }
    return 0;
}
